﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace UusAhi
{
    public class Player
    {
#region fields

        private String _name;
        private Vector2 _location;

        public Texture2D bitmap;

#endregion

#region properties

        public String Name
        {
            get { return _name; }
            set { _name = value; }
        }
        
        public Vector2 Location
        {
            get { return _location; }
            set { _location = value; }
        }

#endregion

        public Player() { }

        public Player(String name)
        {
            _name = name;
            bitmap = Game.content.Load<Texture2D>("Sprites/Player");
            
            _location.X = (int)Game.rand.Next(1100);
            _location.Y = (int)Game.rand.Next(600);
        }

        public void Draw(SpriteBatch spriteBatch) {
            spriteBatch.Draw(
                bitmap,
                new Rectangle((int)this._location.X, (int)this._location.Y, this.bitmap.Width, this.bitmap.Height),
                null,
                Color.White,
                0,
                new Vector2(bitmap.Width / 2, bitmap.Height / 2),
                SpriteEffects.None, 0);
        }
    }
}
